#include "sgl.h"

/* STM32H750 AXI RAM, size is 512KB */
char *fbp = (char *)0x24000000;

void sgl_disp_pixel(int16_t x, int16_t y, int color)
{
    uint16_t* pp = (uint16_t*)fbp;
    pp[y*SGL_CONFIG_PANEL_XRES+x] = color;
}


void sgl_disp_area(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int color)
{
    uint16_t* pp = (uint16_t*)fbp;
    for(int i=y1; i<y2; i++ )
    {
        for(int j = x1; j < x2 ; j ++)
        {
           (pp[j + SGL_CONFIG_PANEL_XRES*i]) = color;
        }
    }
}
